<?xml version="1.0"?>
<JWM>

    <!-- The root menu. -->
    <RootMenu onroot="23">
        <Program label="App">xfce4-appfinder</Program>
        <Program label="Terminal">xfce4-terminal</Program>
        <Program label="Telegramm">telegram.sh</Program>
        <Program label="Viber">viber.sh</Program>
        <Menu label="Utilities">
            <Program label="Window Properties">
                xprop | xmessage -file -
            </Program>
            <Program label="Window Information">
                xwininfo | xmessage -file -
            </Program>
	    <Program label="Configure JWM">
                mousepad ~/.jwmrc
            </Program>
	    <Program label="Restart JWM">
                jwm -restart
            </Program>
        </Menu>
        <Separator/>
        <Program label="Sleep">
            systemctl suspend
        </Program>
        <Program label="Reboot">
            systemctl reboot
        </Program>
        <Program label="Shutdown">
            systemctl poweroff
        </Program>

        <Restart label="Restart" />
        <Exit label="Exit" confirm="true"/>
        <Separator/>
    </RootMenu>

    <!-- Options for program groups. -->
    <Group>
        <Class>Pidgin</Class>
        <Option>sticky</Option>
    </Group>
    <Group>
        <Name>xterm</Name>
        <Option>vmax</Option>
    </Group>
    <Group>
        <Name>xclock</Name>
        <Option>drag</Option>
        <Option>notitle</Option>
    </Group>

    <!-- Tray at the bottom. -->
    <Tray x="0" y="-1" autohide="off">

        <TrayButton icon="/home/oll/.icons/Apple-grey-icon.png">root:2</TrayButton>
        <Spacer width="4"/>
        <TrayButton icon="/home/oll/.icons/Mac-Spaces-icon.png">showdesktop</TrayButton>
        <Spacer width="4"/>
	    <TrayButton icon="/home/oll/.icons/Mac-Terminal-icon.png">exec: xfce4-terminal</TrayButton>
	    <TrayButton icon="/home/oll/.icons/mac-os-icon.png">exec: doublecmd</TrayButton>
	    <TrayButton icon="/home/oll/.icons/Apps-google-chrome-icon.png">exec: google-chrome</TrayButton>
	    <TrayButton icon="/home/oll/.icons/edit-sublime-text-icon.png">exec: /opt/sublime_text/sublime_text</TrayButton>
	    <Spacer width="4"/>

        <Pager labeled="true"/>

        <TaskList maxwidth="125"/>

        <Dock/>
	    <Spacer width="4"/>
        <Clock format="%d/%m/%Y %A %H:%M"><Button mask="123">exec:mousepad</Button></Clock>
        
        <!-- IF YOU LIKE TO HAVE YOUR USERNAME IN THE DOCK, UNCOMMENT FOLLOWING 2 LINES.
        
        <!-- <Spacer width="4"/> -->
        <!-- <TrayButton label="Psyringe"></TrayButton> -->
    </Tray>

    <!-- Visual Styles -->
    <WindowStyle>
        <Font>Sans-9:bold</Font>
        <Width>4</Width>
        <Height>24</Height>
        <Corner>0</Corner>
        <Foreground>#FFFFFF</Foreground>
        <Background>#999999</Background>
        <Outline>#000000</Outline>
        <Opacity>0.5:0.9:0.1</Opacity>
        <Active>
            <Foreground>#FFFFFF</Foreground>
            <Background>#000000</Background>
            <Outline>#000000</Outline>
            <Opacity>1.0</Opacity>
        </Active>
    </WindowStyle>
    <TrayStyle group="true" list="all">
        <Font>Sans-9</Font>
        <Background>#333333</Background>
        <Foreground>#FFFFFF</Foreground>
        <Outline>#000000</Outline>
        <Opacity>0.75</Opacity>
    </TrayStyle>
    <PagerStyle>
        <Outline>#000000</Outline>
        <Foreground>#555555</Foreground>
        <Background>#333333</Background>
        <Text>#FFFFFF</Text>
        <Active>
            <Foreground>#0077CC</Foreground>
            <Background>#555555</Background>
        </Active>
    </PagerStyle>
    <MenuStyle>
        <Font>Sans-9</Font>
        <Foreground>#FFFFFF</Foreground>
        <Background>#333333</Background>
        <Outline>#000000</Outline>
        <Active>
            <Foreground>#FFFFFF</Foreground>
            <Background>#0077CC</Background>
        </Active>
        <Opacity>0.85</Opacity>
    </MenuStyle>
    <PopupStyle>
        <Font>Sans-9</Font>
        <Foreground>#000000</Foreground>
        <Background>#999999</Background>
    </PopupStyle>

    <!-- Path where icons can be found.
         IconPath can be listed multiple times to allow searching
         for icons in multiple paths.
      -->
    <IconPath>
        /usr/share/icons/wm-icons/32x32-aquafusion
    </IconPath>

    <!-- Virtual Desktops -->
    <!-- Desktop tags can be contained within Desktops for desktop names. -->
    <Desktops width="2" height="1">
        <!-- Default background. Note that a Background tag can be
              contained within a Desktop tag to give a specific background
              for that desktop.
         -->
        <!-- <Background type="solid">#111111</Background> -->
	<Background type="command">feh --bg-scale /home/oll/.config/dwm/black.jpg </Background>
    </Desktops>

    <!-- Double click speed (in milliseconds) -->
    <DoubleClickSpeed>400</DoubleClickSpeed>

    <!-- Double click delta (in pixels) -->
    <DoubleClickDelta>2</DoubleClickDelta>

    <!-- The focus model (sloppy or click) -->
    <FocusModel>click</FocusModel>

    <!-- The snap mode (none, screen, or border) -->
    <SnapMode distance="10">border</SnapMode>

    <!-- The move mode (outline or opaque) -->
    <MoveMode>opaque</MoveMode>

    <!-- The resize mode (outline or opaque) -->
    <ResizeMode>opaque</ResizeMode>

    <!-- Startup -->
    <StartupCommand>
		picom --config /home/oll/.config/dwm/picom.conf &
		xrandr --dpi 112 &
		/bin/bash -c "sleep 2; DISPLAY=:0.0 setxkbmap -layout us,ru -option grp:caps_toggle,grp_led:scroll" &
        nm-applet &
        xxkb &
    </StartupCommand>
    
    <RestartCommand>
        pkill nm-applet
        pkill xxkb
        pkill picom
		pkill xrandr
		pkill setxkbmap
		picom --config /home/oll/.config/dwm/picom.conf &
		xrandr --dpi 112 &
		/bin/bash -c "sleep 2; DISPLAY=:0.0 setxkbmap -layout us,ru -option grp:caps_toggle,grp_led:scroll" &
        nm-applet &
        xxkb &
    </RestartCommand>

    <!-- Key bindings -->
    <Key key="Up">up</Key>
    <Key key="Down">down</Key>
    <Key key="Right">right</Key>
    <Key key="Left">left</Key>
    <Key key="h">left</Key>
    <Key key="j">down</Key>
    <Key key="k">up</Key>
    <Key key="l">right</Key>
    <Key key="Return">select</Key>
    <Key key="Escape">escape</Key>

    <Key mask="A" key="Tab">nextstacked</Key>
    <Key mask="A" key="F4">close</Key>
    <Key mask="AC" key="D">showdesktop</Key>
    <Key mask="A" key="F1">root:2</Key>
    <Key mask="A" key="F2">window</Key>
    <Key mask="A" key="F10">maximize</Key>
    <Key mask="A" key="F11">fullscreen</Key>
    <Key mask="AC" key="Right">rdesktop</Key>
    <Key mask="AC" key="Left">ldesktop</Key>
    <Key mask="AC" key="Up">udesktop</Key>
    <Key mask="AC" key="Down">ddesktop</Key>
    <Key mask="AC" key="T">exec: xfce4-terminal</Key>
    <Key mask="AC" key="P">exec: dmenu_run</Key>
    <Key mask="AS" key="S">exec:/bin/bash -c /usr/local/bin/powermenu.sh</Key>   
    <Key mask="AC" key="X">exec: xkill</Key>
    <Key mask="CS" key="Escape">exec: xfce4-taskmanager</Key>
    

</JWM>
